<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>关键帧动画-轮播案例</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .swiper-container{
            width: 640px;
            height: 300px;
            margin: auto;
            overflow: hidden;
        }
        .swiper-container img{
            width: 640px;
            height: 300px;
        }
        .swiper-slide{
            float: left;
        }
        .swiper-wrapper{
            width: 9999px;
            animation: run 10s linear infinite;
        }
        .swiper-wrapper:hover{
            animation-play-state: paused;
        }
        @keyframes run {
            0%{transform: translateX(0);}
            5%{transform: translateX(-640px);}
            25%{transform: translateX(-640px);}
            30%{transform: translateX(-1280px);}
            50%{transform: translateX(-1280px);}
            55%{transform: translateX(-1920px);}
            75%{transform: translateX(-1920px);}
            80%{transform: translateX(-2560px);}
            100%{transform: translateX(-2560px);}
        }
    </style>
</head>
<body>
    <div class="swiper-container">
       <div class="swiper-wrapper">
            <div class="swiper-slide">
                <img src="img/1.jpg" alt="">
            </div>
            <div class="swiper-slide">
                <img src="img/2.jpg" alt="">
            </div>
            <div class="swiper-slide">
                <img src="img/3.jpg" alt="">
            </div>
            <div class="swiper-slide">
                <img src="img/4.jpg" alt="">
            </div>
            <div class="swiper-slide">
                <img src="img/1.jpg" alt="">
            </div>
       </div>
    </div>
</body>
</html>